﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Preactor.ObjectModel.Interfaces;

namespace Preactor.ObjectModel.Entities
{
    public static class TdfValidator
    {
        public static void ValidateResourceField(this PreactorObjectModel pom)
        {
            // Make sure resource field does not have FREE FORMAT Classification.
            var ffpResource = pom.GetFormatFieldPair<IOperation>( x => x.ResourceName );

            if(pom.DoesFieldContainClassification( ffpResource, "FREE FORMAT" ))
            {
                throw new ArgumentException("The Resource field has a FREE FORMAT classification that must be removed in order to use POM.");
            }
        }
    }
}
